import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [


    {
        path: '/login',
        name: 'Login',
        component: () => import(/* webpackChunkName: "about" */ '../views/enter/index.vue')
    },
    {
        path: '/main',
        name: 'Main',
        component: () => import(/* webpackChunkName: "about" */ '../views/main/index.vue'),
        children: [
            {
                path: 'index',
                name: 'Index',
                component: () => import(/* webpackChunkName: "about" */ '../views/index/index.vue')
            },
            {
                path: 'brand',
                name: 'Brand',
                component: () => import(/* webpackChunkName: "about" */ '../views/brand/index.vue')
            },
            {
                path: 'admin',
                name: 'Admin',
                component: () => import(/* webpackChunkName: "about" */ '../views/admin/index.vue')
            },
            {
                path: 'role',
                name: 'ROLE',
                component: () => import(/* webpackChunkName: "about" */ '../views/role/index.vue')
            },

            {
                path: 'menu',
                name: 'MENU',
                component: () => import(/* webpackChunkName: "about" */ '../views/menu/index.vue')
            },


            {
                path: 'schedule',
                name: 'schedule',
                component: () => import(/* webpackChunkName: "about" */ '../views/schedule/index.vue')
            },


        ]


    },


    // {
    //   path: '/main',
    //   name: 'Main',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/main.vue')
    // },
    // {
    //   path: '/',
    //   name: 'Home',
    //   component: Home
    // },
    // {
    //   path: '/about',
    //   name: 'About',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    // }
]

const router = new VueRouter({
    //解决请求路径中是否有#  配置history没有#  没配置有#
    mode: 'history',
    routes
})

export default router
